package com.digitalchina.lxnsy.activity.old;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.base.BaseActivity;
import com.digitalchina.lxnsy.entity.HelpAndSupportVO;
import com.digitalchina.lxnsy.toolkit.GotoUtil;

import java.util.Map;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.activity
 * 创建人：郑皓
 * 创建时间：2017/3/3 11:08
 * 修改备注：
 * ================================================
 */
public class IssueDetailActivity extends BaseActivity {

    @Bind(R.id.issue_detail_tv_title)
    TextView issueDetailTvTitle;
    @Bind(R.id.issue_detail_tv_content)
    TextView issueDetailTvContent;
    @Bind(R.id.issue_detail_tv_evaluate)
    TextView issueDetailTvEvaluate;
    @Bind(R.id.issue_detail_ll_manual_operation)
    LinearLayout issueDetailLlManualOperation;

    private Map<String, Object> map;
    private HelpAndSupportVO helpAndSupportVO;

    @Override
    public void setLayout() {
        setContentLayout(R.layout.activity_issue_detail);
        setTitle("问题详情");
    }

    @Override
    public void initMember() {

        map = (Map<String, Object>) getIntent().getSerializableExtra("map");
        helpAndSupportVO = (HelpAndSupportVO) map.get("HelpAndSupportVO");

        if (helpAndSupportVO == null)
            return;

        issueDetailTvTitle.setText(helpAndSupportVO.getTitle());
        issueDetailTvContent.setText(helpAndSupportVO.getContent());
    }

    @Override
    public void addListener() {

    }

    @Override
    public void setHandler() {

    }

    @Override
    public void callBack(Object object) {

    }

    @Override
    public void rightOnClick() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.issue_detail_tv_evaluate, R.id.issue_detail_ll_manual_operation})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.issue_detail_tv_evaluate: // 评价
                GotoUtil.gotoActivity(IssueDetailActivity.this, IssueEvaluateActivity.class, "map", map);
                break;
            case R.id.issue_detail_ll_manual_operation: // 人工服务
                GotoUtil.gotoActivity(IssueDetailActivity.this, ChooseExpertsListActivity.class, "map", map);
                break;
        }
    }
}
